 import {createRouter,createWebHistory} from 'vue-router'

import Home from '@/page/Home.vue'
import News from '@/page/News.vue'
import About from '@/page/About.vue'
import Detail from '@/page/Detail.vue'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: Home
        },
        {
            path: '/news',
            component: News,
            children: [
                {
                    name:'newsDetail',
                    path: 'detail/:id/:content',
                    component: Detail
                }
            ]
        },
        {
            path: '/about',
            component: About
        }

    ]
})

export default router